1. Field of the Invention
The present invention relates generally to image processing using a computer system. In particular, the present invention is directed to a system and method for warping pixels from one location to another in a computer graphics environment.
2. Description of the Related Art
In the image processing arts, there is often a need to alter an image such that it appears to transform over time into another image. This effect is commonly referred to as “warping”. Given an image, an artist can create a source set of splines and a destination set of splines. As is known by those of skill in the art, a spline is a curve described by a point location, tangent length and tangent direction. A series of points around an object can follow the object quite closely, thus allowing it to be manipulated. Warping technology allows an image to be transformed from a first image to a second image by interpolating the pictures between the two splines.
For example, given a circle that is to be changed into a square, a spline around a circle is the source and around a square is the target. For each intermediate step between the two images, a warping algorithm calculates where the individual pixels within the frame should move to reach a final destination.
A morphing process is a specialized type of a warp in which the initial image and final image warp towards and dissolve into each other. As another example, to morph an adult face into a baby face, an artist might draw a set of splines around the adult's eyes, nose, mouth, ears, hairline, and jaw line; and then create corresponding sets of spline curves around the baby's features; the morph takes those pixels and changes their location from the adult's location to the baby's location, creating a scrunched-up face.
Alternatively, a warping operation can cause an image to grow—for example, if the baby's picture described above were warped into an adult face. However, if part of the image is moved outside of the visible window area, changes to the non-visible image are lost. In subsequent operations, if those areas are brought back into frame they are black and contain no image data. Conventional warper algorithms do not keep track of the image regions that are being warped. Consequently, if a warping or morphing process is applied to an image causing the image to move outside of the viewable window, it is no longer calculated as part of the image.
One conventional work-around to this problem has been to set the viewing area to be very large, in order to encompass any potential expansion of the image. However, this requires that enough resources such as RAM and processing power be available to render all of an image all of the time, even if it is not being displayed.
Accordingly, there is a need for a system and method for improved warping in an image processing and compositing environment.